//
//  SMAccountHeardCell.m
//  lishiminOC
//
//  Created by p2p on 16/10/13.
//  Copyright © 2016年 p2p. All rights reserved.
//

#import "SMAccountHeardCell.h"

@interface SMAccountHeardCell()
//没有登录显示
@property (nonatomic,strong)UIImageView *heardImageView;
@property (nonatomic,strong)UILabel *logionLabel;
@property (nonatomic,strong)UIImageView *goinImageView;
//登录后显示的界面
@property (nonatomic,strong)UIImageView *smallHeardImageView;
@property (nonatomic,strong)UILabel *accountNameLabel;
@property (nonatomic,strong)UILabel *accountNumberLabel;
@property (nonatomic,strong)UIView *intervalView;
@property (nonatomic,strong)UILabel *useableNameLabel;
@property (nonatomic,strong)UILabel *dollarLabel;
@property (nonatomic,strong)UILabel *useableNumberMoneyLabel;
@end

@implementation SMAccountHeardCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
   
}
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupUI];
    }
    return self;
}


- (void)setupUI{
    BOOL isCheck = NO;
    if (isCheck) {
        //登录后显示的页面
        
        
        
    } else {
        //没有登录时显示的状态
        UIImageView *heardImageView = [[UIImageView alloc]init];
        heardImageView.image = [UIImage imageNamed:@"accountBigLog"];
        self.heardImageView = heardImageView;
        [self addSubview:heardImageView];
        
        UILabel *logionLabel = [[UILabel alloc]init];
        logionLabel.text = @"登录/注册";
        logionLabel.textAlignment = NSTextAlignmentLeft;
        logionLabel.font = [UIFont systemFontOfSize:25];
        logionLabel.textColor = [UIColor redColor];
        self.logionLabel =logionLabel;
        [self addSubview:logionLabel];
        
        UIImageView *goinImageView = [[UIImageView alloc]init];
        goinImageView.image = [UIImage imageNamed:@"arrow_gray"];
        self.goinImageView = goinImageView;
        [self addSubview:goinImageView];
    
    }
}

- (void)layoutSubviews{
    BOOL isCheck = NO;
    __weak __typeof(&*self)weakSelf = self;
    if (isCheck) {
        //登录后显示的页面
        
    } else {
        //没有登录时显示的状态
        
        [self.heardImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            //
            make.centerY.mas_equalTo(weakSelf.mas_centerY);
            make.left.equalTo(weakSelf.mas_left).with.offset(15);
            make.width.mas_equalTo(@55);
            make.height.mas_equalTo(@55);
        }];
        
        [self.logionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            //
            make.centerY.mas_equalTo(weakSelf.mas_centerY);
            make.left.equalTo(weakSelf.heardImageView.mas_right).with.offset(15);
            make.right.equalTo(weakSelf.goinImageView.mas_left).with.offset(-15);
            make.top.equalTo(weakSelf.mas_top).with.offset(15);
            make.bottom.equalTo(weakSelf.mas_bottom).with.offset(-15);
            
        }];
        
        [self.goinImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            //
            make.centerY.mas_equalTo(weakSelf.mas_centerY);
            make.right.equalTo(weakSelf.mas_right).with.offset(-15);
            make.width.mas_equalTo(@15);
            make.height.mas_equalTo(@15);
        }];
        
    }
}

#pragma mark - 点击登录推出的方法

- (void)goToLogionViewController{
    NSLog(@"meiyouwenti");
}


@end
